#exerc4.py  要求系统能随机生成一个由大小写字母组成的4位验证码
from random import *
#随机生成验证码
def generateCaptcha():
    ls1 = []
    ls2 = []
    for i in range(26):
        a = chr(randint(65, 90))
        b = chr(randint(97, 122))
        ls1.append(a)
        ls2.append(b)
    pop = ls1 + ls2
    a = sample(pop, 4)
    for i in a:
        print(i, end="")
generateCaptcha()